package com.sdkj.dspservice.common.shiro;

import com.sdkj.dspservice.common.utils.UserUtils;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;
 
public class CustomCredentialsMatcher extends SimpleCredentialsMatcher {
 
    @Override
    public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) {
        return UserUtils.passwordVerify(String.valueOf(((UsernamePasswordToken) authcToken).getPassword()), String.valueOf(getCredentials(info)));
    }
 
}